package collections1;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Scanner;
/*
* 计算当前时间距“世界末日”已经过去了多少天（2012-12-21）
* 
*/
public class Tian {
public static void main(String[] args) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Scanner sc = new Scanner(System.in);
System.out.print("请输入世界末日时间, 输入格式为:yyyy-MM-dd");
String Theendoftheworld = sc.nextLine();
Date birDate = sdf.parse(Theendoftheworld);
Date now = new Date();
long time = now .getTime() - birDate.getTime();
long day = time/1000/60/60/24;
System.out.println("到今天一共过了:"+day+"天");
}

}